home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group03a.txt / 000083_icon-group-sender_Mon Jul 14 09:12:43 2003.msg < prev    next >
Internet Message Format  |  2003-12-22  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id h6EGBVg17104
  4.     for icon-group-addresses; Mon, 14 Jul 2003 09:11:31 -0700 (MST)
  5. Message-Id: <200307141611.h6EGBVg17104@baskerville.CS.Arizona.EDU>
  6. X-Sender: kazimir@chem.pmf.hr
  7. Date: Sun, 13 Jul 2003 00:16:01 +0200
  8. To: icon-group@cs.arizona.edu
  9. From: "Majorinc, Kazimir" <Kazimir@chem.pmf.hr>
  10. Subject: Idiom for Pascal-like with?
  11. X-Trace: ls401.hinet.hr 1058048309 15022 195.29.140.193 (Sun, 13 Jul 2003 00:18:29 +0200)
  12. X-Spam-Status: No, hits=-0.5 required=5.0
  13.     tests=IN_REP_TO
  14.     version=2.55
  15. X-Spam-Checker-Version: SpamAssassin 2.55 (1.174.2.19-2003-05-19-exp)
  16. Errors-To: icon-group-errors@cs.arizona.edu
  17. Status: RO
  18.  
  19. Hi.
  20.  
  21. Is there any idiom in Icon that can replace Pascal-like with statement. For 
  22. example, I'd like to write something like:
  23.  
  24.  
  25. #----imaginary.icn
  26.  
  27. record Polar(r,phi)
  28. record Cartesian(x,y)
  29.  
  30. Ap:=Polar(1, 3.14)
  31. Ac:=Cartesian(0, 0)
  32.  
  33. ....
  34.  
  35. with Ap & Ac
  36.    do { x:=r*cos(phi)
  37.         y:=r*sin(phi)
  38.       }
  39.  
  40. ...
  41.  
  42. #-----end of imaginary.icn---------
  43.  
  44.  
  45. What would you do to eliminate redundant "P1." and "C1." parts?
  46.  
  47. Thanks.
  48.  
  49.  
  50.  
  51. --------------
  52. Kazimir Majorinc, Zagreb, Croatia  
  53.  
  54.